<template>
  <div class="m-nodes">
    <!-- <div class="reward flex-left">
      <div class="total">
        <p>
          140,269,236
          <span>BTY</span>
        </p>
        <h1>已发放节点奖励(个)</h1>
      </div>
      <div class="last-reward">
        <p>
          0.9
          <span>BTY</span>
        </p>
        <h1>节点奖励（个/天）</h1>
      </div>
    </div>-->
    <div class="nodes-container table-shadow">
      <div class="head flex-left">
        <i class="iconfont iconjiedianxuanze"></i>
        <span>共 {{total}} 个节点</span>
      </div>
      <nodes-map :nodes="nodes" :range="range" :needRange="false"></nodes-map>
      <div class="nodes-list">
        <div class="time">{{nowTime}}</div>
        <div class="scroll-box">
          <div class="node-item" v-for="(item,index) in nodes" :key="index">
            <p>{{index+1}} {{item.name}}</p>
            <div class="flex-left">
              <el-progress
                :percentage="Number((item.value*100/total).toFixed(2))"
                class="node-progress"
                :show-text="false"
              ></el-progress>
              <span class="percent-txt">{{item.value}} （{{(item.value*100/total).toFixed(2)}}%）</span>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import nodesMap from "./Map.vue";
import NodesBase from "@/mixins/Nodes/nodesBase.js";
export default {
  mixins: [NodesBase],
  components: {
    nodesMap
  }
};
</script>

<style lang="scss" scoped>
.m-nodes {
  padding: 10px 20px 20px;
  .reward {
    height: 60px;
    background: $white;
    .total,
    .last-reward {
      display: inline-block;
      text-align: center;
      padding-left: 20px;
      height: 45px;
      h1 {
        margin-top: 5px;
        font-size: 12px;
        color: $font_grey;
      }
      p {
        margin-top: 0px;
        font-size: 16px;
        font-family: PingFangSC-Semibold;
        font-weight: 500;
        color: $orange;
        span {
          font-size: 12px;
          color: $font_grey;
        }
      }
    }
    .total {
      width: 190px;
      border-right: 1px solid #eaeaea;
    }
  }
  .nodes-container {
    margin-top: 10px;
    background: $white;
    .head {
      height: 35px;
      padding-left: 10px;
      .iconjiedianxuanze {
        color: $blue;
        font-size: 18px;
        margin-right: 10px;
      }
      span {
        font-size: 14px;
        font-family: PingFangSC-Semibold;
        font-weight: 500;
        color: $orange_deep;
      }
    }
    .nodes-list {
      height: 414px;
      border-left: 1px solid #ebeff1;
    }
    .time {
      height: 50px;
      line-height: 50px;
      text-align: center;
      color: $black;
      font-size: 14px;
      border-bottom: 1px solid #ebeff1;
      border-top: 1px solid #ebeff1;
    }
    .scroll-box {
      height: calc(100% - 60px);
      padding: 20px 10px 20px 20px;
      overflow-y: scroll;
      .node-item {
        height: 50px;
        margin-top: 20px;
        p {
          margin-bottom: 10px;
          font-size: 14px;
          color: $black;
          font-family: PingFangSC-Medium;
          font-weight: 500;
        }
        .node-progress {
          width: 170px;
        }
        .percent-txt {
          margin-left: 15px;
          color: $black_title;
        }
      }
      .node-item:first-child {
        margin-top: 0;
      }
    }
    .scroll-box::-webkit-scrollbar {
      width: 5px;
      height: 5px;
      background: #e0e3e6;
    }
    .scroll-box::-webkit-scrollbar-thumb {
      border-radius: 50px;
      background: $blue;
    }
  }
}
</style>
